QuickTime 4 API Documentation

Inside Macintosh: More Macintosh Toolbox

Previous | Chapter Top | Chapter Contents | Next |

Application-Defined Routine

To provide a component, you define a component function and supply the appropriate registration information. You store your component function in a code resource and typically store your component's registration information as resources in a component file. For additional information on this process, see "Creating Components," .

MyComponent

Here's how to declare a component function named MyComponent :

FUNCTION MyComponent (params: ComponentParameters;
                                          storage: Handle): ComponentResult;
params
A component parameters record. The what field of the component parameters record indicates the action your component should perform. The parameters that the client invoked your function with are contained in the params field of the component parameters record. Your component can use the CallComponentFunction or CallComponentFunctionWithStorage routine to extract the parameters from this record.
storage
A handle to any memory that your component has associated with the connection. Typically, upon receiving an open request, your component allocates memory and uses the SetComponentInstanceStorage function to associate the allocated memory with the component connection.

DESCRIPTION

When your component receives a request, it should perform the action specified in the what field of the component parameters record. Your component should return a value of type ComponentResult (a long integer). If your component does not return error information as its function result, it should indicate errors using the SetComponentInstanceError procedure.

SEE ALSO

For information on the component parameters record, see The Component Parameters Record . For information on writing a component, see "Creating Components," .


© 1999 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next